Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Adds Ctrl-Click to Home Button #7881

Merged
merged 2 commits into from
Apr 3, 2017
Merged

Adds Ctrl-Click to Home Button #7881

merged 2 commits into from
Apr 3, 2017

Conversation

jonathansampson
Copy link
Collaborator

@jonathansampson jonathansampson commented Mar 25, 2017

Test Plan

  1. Turn on the Home button
  2. Ctrl+Click or Cmd+Click the Home button to open home page in a new tab
  3. Notice that tab will be opened in the background (ex: it's not active)

Description

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Fixes #7718

@@ -70,7 +70,11 @@ class NavigationBar extends ImmutableComponent {
contextMenus.onReloadContextMenu(target)
}

onHome () {
onHome (e) {
if (e.ctrlKey) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of e.ctrlKey, can you change this to use isForSecondaryAction() in eventUtil? Thanks 😄

@jonathansampson
Copy link
Collaborator Author

@bsclifton Ready for some fresh eyes on this :)

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathansampson I updated the logic; ctrl/cmd + clicking was just opening a new tab (see GIF below- I do cmd + click and then do a regular click afterwards to show difference)
cmd-click-home

I updated the code to use the existing logic, except to also consider eventUtil.isForSecondaryAction

Tested with one and multiple homepages, works great 😄 ++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants